<template>
	<view class="px-[30rpx] mb-[40rpx]">
		<view class="flex">
			<u-avatar :src="user.avatar" :size="120"></u-avatar>
			<view class="ml-[20rpx]">
				<view class="text-2xl font-bold mb-[20rpx]">{{ user.mobile }}</view>
				<view class="flex  mb-[20rpx]">
					<view class="flex items-center justify-center" @click.stop="copyText(user.sn)">
						<text class="mr-[10rpx]">SN:</text>
						<text class="">{{ user.sn }}</text>
						<u-icon class="ml-[15rpx]" size="26" name="/static/images/common/copy.png"></u-icon>
					</view>
				</view>
				<view class="text-[#00D2E0] flex items-center">
					<u-icon class="mr-[10rpx]" size="42" :name="member.logo"></u-icon>
					<text class="">{{ member.name }}</text>
				</view>
			</view>
		</view>
		
	</view>
</template>
<script lang="ts" setup>
	import { useCopy } from '@/hooks/useCopy'
	import { t } from '@/utils/util'

	const props = defineProps({
		user: {
			type: Object,
			default: () => ({})
		},
		member: {
			type: Object,
			default: () => ({})
		}
	})
	const { copy } = useCopy()
	
	const copyText = async (text : string) => {
		copy(text);
		uni.$u.toast(t('common.copySuccess'))
	}
	
</script>

<style lang="scss" scoped>
</style>